using KenEgozi.Com.Domain.Aggregates.Tag;
using KenEgozi.Com.Domain.Interfaces.Factories;
using KenEgozi.Com.Domain.Interfaces.Services;

namespace KenEgozi.Com.Domain.Factories
{
	public class TagFactory : ITagFactory
	{
		private readonly IUrlFriendlyStringTransformService urlFriendlyStringTransformService;
		public TagFactory(IUrlFriendlyStringTransformService urlFriendlyStringTransformService)
		{
			this.urlFriendlyStringTransformService = urlFriendlyStringTransformService;
		}

		public Tag Create(string name)
		{
			Tag tag = new Tag();
			tag.Name = name;
			tag.UrlFriendlyName = urlFriendlyStringTransformService.Execute(name);
			return tag;
		}
	}
}